import {
	request
} from "./request.js";

// 用户登录
export const login = (data = {}) => {
	return request({
		url: "/user/login",
		method: "POST",
		data
	})
}

// 用户注册
export const register = (data = {}) => {
	return request({
		url: "/user/register",
		method: "POST",
		data
	})
}

// 发送注册验证码
export const sendRegisterCaptcha = (data = {}) => {
	return request({
		url: "/user/register-captcha",
		data
	})
}

// 获取用户详细信息
export const getInfo = () => {
	return request({
		url: "/user/info"
	})
}

// 发送更新密码验证码
export const sendUpdatePasswordCaptcha = (data = {}) => {
	return request({
		url: "/user/update_password/captcha",
		data
	})
}

// 更新密码
export const updatePassword = (data = {}) => {
	return request({
		url: "/user/update_password",
		data,
		method: "POST"
	})
}

// 更新用户个人信息
export const updateUserInfo = (data = {}) => {
	return request({
		url: "/user/update",
		data,
		method: "POST"
	})
}
// 更新用户个人信息验证码
export const sendUpdateUserInfoCaptcha = (data = {}) => {
	return request({
		url: "/user/update/captcha",
		data
	})
}

export const queryNotification = (data = {}) => {
	return request({
		url: `/user/notification/${data.userId}`
	})
}